#include "Platform.h"
#include "RSManager.h"
#include "Box.h"
#include "Sprite.h"
#include "GameDefine.h"
Platform::Platform(Box* box ): StaticObject(box , PLATFORM)
{
	left =box->_position.x;
	right =_box->_position.x+ box->_size.x;
	_box->_size =D3DXVECTOR2(64,50);

}
//comment comment

Platform::~Platform(void)
{
}
void Platform::init()
{

	_sprite= RSManager::getInstance()->getSprite(MOVE_PLATFORM);	
}

void Platform::update()
{

	if(_box->_position.x >= right)
		_box->_v.x= -2;
	if(_box->_position.x <= left )
		_box->_v.x =2;
	_box->_position.x+=_box->_v.x;


}

void Platform::render()
{
	_sprite->Render(_box->_position);
}
